/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package utiles;

import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Calendar;
import java.util.Locale;

/**
 *
 * @author Felipe
 */
public class GrabarException
{
    public static void grabarExcepcion (Exception ex)
    {
        try
        {
            Calendar c = Calendar.getInstance();
            
            File file = new File (UtilesCalendar.getStringCompleto(c) + " - " + ex.getClass().toString());
            FileOutputStream fos = new FileOutputStream(file);
            PrintStream ps = new PrintStream(fos);
            
            ex.printStackTrace(ps);
            
            fos.close();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
